package com.ebook.ui.fragment.home.usercenter;

import com.ebook.entity.User;
import com.ebook.ui.fragment.home.everyrecommend.ImgContainer;

import javax.swing.*;

public class Already_login extends JPanel{
    //120 * 40
    private final ImgContainer icon;
    private final JLabel nickname;
    public Already_login(User user){
        super();
        setLayout(null);
        this.setBounds(0,0,120,40);
        icon = new ImgContainer(new ImageIcon(user.getIconUrl()).getImage(),user);
        nickname = new JLabel(user.getUserName());
        icon.setBounds(0,0,40,40);
        nickname.setBounds(40,0,80,40);
        add(icon);
        add(nickname);
    }
}
